﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Mobile.Mvc;
using Microsoft.Practices.Mobile.ContainerModel;

namespace MVCTestClientContainer
{
    public class ControllerProvider : IControllerProvider
    {
        private Container container;
        
        public ControllerProvider(Container container)
        {
            this.container = container;
        }       
       
        #region IControllerProvider Members       

        public Controller GetController<T>()
        {
            return this.container.Resolve<T>() as Controller;           
        }

        public Controller GetController<T>(IView view)
        {
            Controller controller = this.container.Resolve<Controller>();
            controller.View = view;
            return controller;
        }

        public Controller GetController(string name)
        {
            throw new NotImplementedException();
        }

        public Controller GetController(Type type)
        {
            throw new NotImplementedException();
        }

        public void RegisterController(Controller controller)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
